feat: Add comprehensive SEO build-time data, sitemap generation, and webmaster analytics tracking#108
Conversation
- Built a custom `scripts/build_seo_data.js` to automatically extract text from localization files, changelog, and geojson/company datasets to generate `public/seo_data.json`. - Integrated `vite-plugin-sitemap` and a custom Vite plugin into `vite.config.js` to dynamically generate a `/sitemap.xml` and inject `ld+json` and SEO meta tags into `index.html` at build time. - Set up a utility `src/utils/analytics.ts` to manage event routing for Google Analytics (GA4), Baidu Tongji, and Bing UET. - Injected generic tracking anchors in `index.html` allowing dynamic IDs via environment variables. - Hand-instrumented critical user actions throughout the React components, including: User Registration, Login, Backup JSON Import/Export, KML Export, Adding/Editing Trips, Auto-routing, Adding/Editing Pins, and Folder Management. - Created `scripts/submit_search_engines.js` to automatically ping/push URLs to Google, Bing, and Baidu webmaster APIs. Co-authored-by: OsakaLOOP <68284076+OsakaLOOP@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR implements a robust, locally generated, zero-server-dependency SEO and Analytics solution as requested.
npm run prebuildstep executingscripts/build_seo_data.js. It traverses the locale/changelog files for UI text and features, and parsescompany_data.jsonand anygeojson/*.geojsonfor company, line, and station names. This gets built intopublic/seo_data.json.vite.config.jsnow uses this JSON to inject highly targetedmeta description,keywordsand structuredld+json(Schema WebSite) directly into the builtindex.html.vite-plugin-sitemapto ensuresitemap.xmlcovers the root domainhttps://rail.s3xyseia.xyzaccurately._hmt.push), and Bing UET (uetq.push) in a unifiedtrackEventinterface insrc/utils/analytics.ts. Added tracking logic into Modals (Login, Trip Edit, Github, Folders, Pins) and layout buttons (Import/Export).index.htmlpulling from%VITE_BAIDU_TONGJI_ID%and%VITE_BING_UET_ID%.scripts/submit_search_engines.jsrelying securely on environment tokens for Bing and Baidu to help index the newly created sitemap.PR created automatically by Jules for task 10289299139600741089 started by @OsakaLOOP